package com.kasax.skin2.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class MyFragmentPagerAdapte extends FragmentPagerAdapter {


        private final List<Fragment> fragmetns;
        private final List<String> pagesTitles;

        public MyFragmentPagerAdapte(FragmentManager supportFragmentManager, List<Fragment> fragments, List<String> pageTitles) {
            super(supportFragmentManager);
            this.fragmetns = fragments;
            this.pagesTitles = pageTitles;
        }


        @NonNull
        @Override
        public Fragment getItem(int position) {
            return fragmetns.get(position);
        }

        @Override
        public int getCount() {
            return fragmetns.size();
        }

        @Nullable
        @Override
        public CharSequence getPageTitle(int position) {
            return pagesTitles.get(position);
        }
    }